<?php


namespace App\Request\client;


use App\Request\CommonRequest;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;

class UserRequest extends CommonRequest
{
    protected $name = '用户信息上报验证';

    protected $rule = [
        'appUploadFriendInfo' => [
            'nickname' => 'required_without:mobile',
            'mobile' => 'required_without:nickname',
        ],
        'appFriendTalk' => [
            'token' => 'required|max:255',
        ]
    ];

    protected $message = [
        'nickname.required' => '用户通讯录名称不能为空',
        'mobile.required' => '用户手机号码不能为空',
        'token.required' => '设备未登录',
    ];


    /**
     * 验证
     * @param array $params
     * @param string $scenes
     * @return bool
     * @throws ContainerExceptionInterface
     * @throws NotFoundExceptionInterface
     */
    public function validated(array $params, string $scenes): bool
    {
        return $this->__validated($params, $scenes);
    }
}